<template>
    <div id="tabs">
        <div class="content">
            <div class="title_group">
                <div class="tab_item" v-for="(item, index) in tabList" :key="index" :class="{'tabActive': act == index}" @mouseover="act = index" >
                    {{ item.name }}
                </div>
            </div>
            <!-- neirong -->
            <div class="container">
                <!-- left -->
                <div class="left_content">
                    <div class="title">
                        免费学
                    </div>
                    <div class="lunbo">
                        <el-carousel height="312px">
                            <el-carousel-item v-for="item in 4" :key="item">
                                <h3 class="small">500 * 312 轮播图片</h3>
                            </el-carousel-item>
                        </el-carousel>
                    </div>
                    <div class="imgs">
                        <div class="imgbox">
                            <img src="" alt=" 240 * 150">
                        </div>
                        <div class="imgbox">
                            <img src="" alt="240 * 150">
                        </div>
                    </div>
                </div>

                <!-- right -->
                <div class="right_content">
                    <div class="title">
                        <div class="txt">服务提醒</div>
                        <div class="more">
                            浏览更多 >>
                        </div>
                    </div>

                    <div class="info_box">
                        <div class="info_item" v-for="(item, index) in infoList" :key="index" >
                            <el-link>{{ item.name }}</el-link>
                        </div>
                    </div>

                    <div class="datalist">
                        <!-- left -->
                        <div class="databox">
                            <div class="data_title">
                                <div class="data_txt">热点资讯</div>
                                <div class="more">更多 >></div>
                            </div>
                            <div class="data_item">
                                <div class="data" v-for="(item, index) in dataList" :key="index">
                                   <i class="el-icon-edit"></i>  {{ item.art }}
                                </div>
                            </div>
                        </div>
                        <!-- right -->
                        <div class="databox">
                            <div class="data_title">
                                <div class="data_txt">资料推荐</div>
                                <div class="more">更多 >></div>
                            </div>
                            <div class="data_item">
                                <div class="data" v-for="(item, index) in dataList" :key="index">
                                   <i class="el-icon-edit"></i>  {{ item.art }}
                                </div>
                            </div>
                        </div>

                    </div>

                    <!-- 题库 -->
                    <div class="tiku">
                        <div class="title">
                             题库
                        </div>
                        <div class="tiku_box">
                            <div class="tiku_item" v-for="(item, index) in tiku" :key="index">
                                <i :class="item.icon"></i> <span> {{ item.name }} </span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        data() {
            return {
                tabList: [
                    { name: "一级消防工程师"},
                    { name: "一级建造师"},
                    { name: "二级建造师"},
                    { name: "安全工程师"},
                    { name: "一级造价工程师"},
                ],
                infoList: [
                    { name: "微信公众号" },
                    { name: "Q群交流" },
                    { name: "考试日历" },
                    { name: "考试提醒" },
                    { name: "招生简章" },
                    { name: "手机APP" },
                    { name: "报考指导" },
                    { name: "报名时间" },
                    { name: "考试时间" },
                    { name: "考试科目" },
                    { name: "报考条件" },
                    { name: "成绩查询" },
                ],
                dataList: [
                    { art: "这是模拟Data,需要从服务器获取!1111111111111111111111" },
                    { art: "这是模拟Data,需要从服务器获取!" },
                    { art: "这是模拟Data,需要从服务器获取!" },
                    { art: "这是模拟Data,需要从服务器获取!" },
                    { art: "这是模拟Data,需要从服务器获取!" },
                ],
                tiku: [
                    { icon: "el-icon-reading", name: "历年真题" },
                     { icon: "el-icon-notebook-1", name: "模拟试题" },
                      { icon: "el-icon-edit", name: "每日一练" },
                       { icon: "el-icon-notebook-2", name: "章节练习" },
                ],
                act: 0,
            }
        },
    }
</script>

<style lang="scss" scoped>
#tabs {
    width: 100%;
    .content {
        width: 1200px;
        box-sizing: border-box;
        overflow: hidden;
        margin: 10px auto;
        // box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
        border-radius: 30px;
        .title_group {
            width: 100%;
            box-sizing: border-box;
            display: flex;
            .tab_item {
                flex: 1;
                font-size: 24px;
                text-align: center;
                height: 60px;
                line-height: 60px;
                border-radius: 30px 30px 0 0;
                border: 1px solid #f2f2f2;
                box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
                
            }
            .tabActive {
                background-color: red;
                color: #fff;
            }
        }
        .container {
            width: 100%;
            box-sizing: border-box;
            padding: 20px;
            display: flex;
            justify-content: space-between;
            .left_content {
                width: 500px;
                .title {
                    font-size: 22px;
                    height: 50px;
                    line-height: 50px;
                    border-bottom: 1px solid #f2f2f2;
                    font-weight: bold;
                }
                .lunbo {
                    width: 500px;
                    height: 312px;
                    overflow: hidden;
                }
                .imgs {
                    width: 100%;
                    margin-top: 20px;
                    display: flex;
                    justify-content: space-between;
                    .imgbox {
                        width: 240px;
                        height: 150px;
                        overflow: hidden;
                        border: 1px solid #f2f2f2;
                        img {
                            width: 240px;
                            height: 150px;
                        }
                    }
                }
            }
            .right_content {
                width: 620px;
                box-sizing: border-box;
                .title {
                    width: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;
                    height: 50px;
                    line-height: 50px;
                    .txt {
                        font-size: 22px;
                        font-weight: bold;
                    }
                    .more {
                        cursor: pointer;
                        &:hover {
                            color: #007eff;
                        }
                    }
                }
                .info_box {
                    width: 100%;
                    display: flex;
                    flex-wrap: wrap;
                    padding: 10px;
                    box-sizing: border-box;
                    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
                    .info_item {
                        width: 100px;
                        height: 40px;
                        line-height: 40px;
                        cursor: pointer;
                        text-align: center;                 
                    }
                }
                .datalist {
                    width: 100%;
                    box-sizing: border-box;
                    display: flex;
                    justify-content: space-between;
                    margin-top: 30px;
                    .databox{
                        width: 290px;
                        
                        .data_title {
                            width: 290px;
                            height: 40px;
                            line-height: 40px;
                            display: flex;
                            align-items: center;
                            justify-content: space-between;
                            border-bottom: 1px solid #f2f2f2;
                            .data_txt {
                                font-size: 22px;
                                font-weight: bold;
                                
                            }
                            .more {
                                cursor: pointer;
                                &:hover {
                                    color: #007eff;
                                }
                            }
                        }
                        .data_item {
                            width: 100%;
                            box-sizing: border-box;
                            .data {
                                width: 100%;
                                overflow: hidden;
                                text-overflow: ellipsis;
                                white-space: nowrap;
                                height: 40px;
                                line-height: 40px;
                            }
                        }
                    }
                   
                }
                 .tiku {
                        width: 100%;
                        .title {
                            font-size: 22px;
                            width: 100%;
                            height: 40px;
                            line-height: 40px;
                            font-weight: bold;
                        }
                        .tiku_box {
                            width: 100%;
                            display: flex;
                            justify-content: space-around;
                            margin-top: 20px;
                            .tiku_item {
                                width: 145px;
                                text-align: center;
                                box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
                                height: 50px;
                                line-height: 50px;
                                cursor: pointer;
                                &:hover {
                                    color: #007eff;
                                }
                            }
                        }
                    }
            }

        }
    }
}
</style>